"""

SpeedCommand.py
Author: Ryan Walters
Date: 10/13/2008

This command is used to adjust the speed of computer players.  

"""

from Command import Command
# this class needs to be changed so that this will work.  It will need to
# have a way to get to the players, check if they're computers, and then
# set wait times
class SpeedCommand(Command):

    def __init__(self, players):
        self.player_list = players

    def execute(self, time):
        if time is not None and time > 30:
            time = 30
        elif time is None:
            time = 0
        self.waitingTime = time
        for player in self.player_list:
            player.setWaitTime(time)
